﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TinyERP.ERP.Entity;

namespace TinyERP.ERP.DTO
{
    public class PhoneNumberDTO
    {
        public long ID { get; set; }

        public string Extension { get; set; }

     
        public string PhoneNumber { get; set; }

        public PhoneNumberType PhoneTypeEnumValue { get; set; }

        public string PhoneType
        {
            get
            {
                switch (this.PhoneTypeEnumValue)
                {
                    case PhoneNumberType.BUSINESS:
                        return "Business";
                        break;
                    case PhoneNumberType.HOME:
                        return "Home";
                        break;
                    case PhoneNumberType.MOBILE:
                        return "Mobile";
                        break;
                    default:
                        break;
                }
                return "";
            }
            set
            {
                string stringValue = value;
                stringValue = stringValue.ToLower();
                if (stringValue == "home")
                {
                    this.PhoneTypeEnumValue = PhoneNumberType.HOME;
                }
                else if (stringValue == "business")
                {
                    this.PhoneTypeEnumValue = PhoneNumberType.BUSINESS;
                }
                else if (stringValue == "mobile")
                {
                    this.PhoneTypeEnumValue = PhoneNumberType.MOBILE;
                }
            }
        }
        public bool IsPrimaryPhoneNumber { get; set; }
    }
}
